#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
int n,u,v,fa[maxn],ans[maxn],cnt,si[maxn],vis[maxn];
vector<int> to[maxn];
priority_queue<int> q;
queue<int> p;
int read(){
    int s=0;
    char ch=getchar(),last=' ';
    while(ch<'0'||ch>'9')
        last=ch,ch=getchar();
    while(ch>='0'&&ch<='9')
        s=(s<<1)+(s<<3)+(ch^48),ch=getchar();
    return last=='-'?-s:s;
}
void write(int x){
	char f[100];
	int cnt=0;
	if(x<0)
		putchar('-'),x*=-1;
	while(x)
		f[++cnt]=x%10+'0',x/=10;
	while(cnt)
		putchar(f[cnt--]);
	putchar(' ');
}
signed main(){
    freopen("choice.in","r",stdin);
    freopen("choice.out","w",stdout);
    n=read();
    for(int i=1;i<n;i++){
        u=read(),v=read();
        to[u].push_back(v);
        to[v].push_back(u);
    }
    p.push(1);int tot;
    while(!p.empty()){
        int u=p.front();
        p.pop();
        if(vis[u])
            continue;
        vis[u]=1;
        for(auto v:to[u])
            if(!vis[v]){
                si[u]++;
                fa[v]=u;
                p.push(v);
            }
    }
    for(int i=1;i<=n;i++)
        if(!si[i])
            q.push(i);
    while(!q.empty()){
        int u=q.top();
        q.pop();
        ans[++cnt]=u;
        if(u==1)
            break;
        si[fa[u]]--;
        if(!si[fa[u]])
            q.push(fa[u]);
    }
    if(cnt!=n)
        puts("-1");
    else
        for(int i=n;i;i--)
            write(ans[i]);
    return 0;
}
